; The frige domain from the UCPOP distripution.

(define (domain fridge-domain)
  (:requirements :equality :negative-preconditions)
  (:predicates (screw ?x)
	       (backplane ?x)
	       (screwed ?x)
	       (holds ?x ?y)
	       (in-place ?x)
	       (part-of ?x ?y)
	       (fridge-on ?x)
	       (covers ?x ?y)
	       (compressor ?x)
	       (attached ?x)
	       (fridge ?x)
	       (ok ?x))
  (:action unscrew
	   :parameters (?x ?y)
	   :precondition (and (screw ?x) (backplane ?y)
			      (screwed ?x) (holds ?x ?y))
	   :effect (not (screwed ?x)))
  (:action screw
	   :parameters (?x ?y)
	   :precondition (and (screw ?x) (backplane ?y)
			      (not (screwed ?x)) (holds ?x ?y))
	   :effect (screwed ?x))
  (:action remove-backplane
	   :parameters (?x ?f ?a ?b ?c ?d)
	   :precondition (and (backplane ?x)
			      (not (= ?a ?b)) (not (= ?a ?c)) (not (= ?a ?d))
			      (not (= ?b ?c)) (not (= ?b ?d)) (not (= ?c ?d))
			      (in-place ?x)
			      (part-of ?x ?f) (not (fridge-on ?f))
			      (holds ?a ?x) (holds ?b ?x)
			      (holds ?c ?x) (holds ?d ?x)
			      (not (screwed ?a)) (not (screwed ?b))
			      (not (screwed ?c)) (not (screwed ?d)))
	   :effect (not (in-place ?x)))
  (:action attach-backplane
	   :parameters (?x ?f ?a ?b ?c ?d)
	   :precondition (and (backplane ?x)
			      (not (= ?a ?b)) (not (= ?a ?c)) (not (= ?a ?d))
			      (not (= ?b ?c)) (not (= ?b ?d)) (not (= ?c ?d))
			      (not (in-place ?x))
			      (part-of ?x ?f) (not (fridge-on ?f))
			      (holds ?a ?x) (holds ?b ?x)
			      (holds ?c ?x) (holds ?d ?x)
			      (not (screwed ?a)) (not (screwed ?b))
			      (not (screwed ?c)) (not (screwed ?d)))
	   :effect (in-place ?x))
  (:action start-fridge
	   :parameters (?f ?a ?b ?c ?d ?x)
	   :precondition (and (not (= ?a ?b)) (not (= ?a ?c)) (not (= ?a ?d))
			      (not (= ?b ?c)) (not (= ?b ?d)) (not (= ?c ?d))
			      (backplane ?x) (in-place ?x) (part-of ?x ?f)
			      (holds ?a ?x) (holds ?b ?x)
			      (holds ?c ?x) (holds ?d ?x)
			      (screwed ?a) (screwed ?b)
			      (screwed ?c) (screwed ?d)
			      (not (fridge-on ?f)))
	   :effect (fridge-on ?f))
  (:action stop-fridge
	   :parameters (?f)
	   :precondition (fridge-on ?f)
	   :effect (not (fridge-on ?f)))
  (:action change-compressor
	   :parameters (?x ?y ?a)
	   :precondition (and (not (= ?x ?y)) (backplane ?a)
			      (not (in-place ?a)) (covers ?a ?x)
			      (compressor ?x) (compressor ?y)
			      (attached ?x) (not (attached ?y)))
	   :effect (and (not (attached ?x)) (attached ?y)
			(not (covers ?a ?x)) (covers ?a ?y))))
